package com.trdcore.zyzkt.controller;

import com.alibaba.fastjson2.JSONObject;

import com.trdcore.zyzkt.resp.ResultData;
import com.trdcore.zyzkt.service.LiveCourseService;
import com.trdcore.zyzkt.utils.AuthContextHolder;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/live/liveCourse")
public class LiveCourseApiController {

	@Resource
	private LiveCourseService liveCourseService;

    @Operation(summary = "获取用户access_token",description = "获取用户access_token")
    @GetMapping("/getPlayAuth/{id}")
    public ResultData<JSONObject> getPlayAuth(@PathVariable("id") Long id) {
        JSONObject object = liveCourseService.getPlayAuth(id, AuthContextHolder.getUserId());
        return ResultData.success(object);
    }

}